﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminSite.Master"
    Inherits="System.Web.Mvc.ViewPage<HYBYSoft.Company.Models.Admin>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Edit
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
    <script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>"
        type="text/javascript"></script>
    <div id="content">
    <div style="margin-top:10px;">
    </div>
        <p>
            <span id="sitemap">当前位置：</span>
        </p>
        <% using (Html.BeginForm())
           { %>
        <%: Html.ValidationSummary(true) %>
        <fieldset>
            <legend>修改成员&nbsp;<%: Model.Name %>&nbsp;信息</legend>
            <%: Html.HiddenFor(model => model.AdminID) %>
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Name) %>：
            </div>
            <div class="editor-field">
                <%: Model.Name %>             
            </div>
            <div class="editor-empty">
            </div>
            <div class="editor-label">
                <%: Html.LabelFor(model => model.OldPassword) %>：
            </div>
            <div class="editor-field">
                <%: Html.PasswordFor(model => model.OldPassword)%>
                <%: Html.ValidationMessageFor(model => model.OldPassword)%><span id="span_validationMessage"></span>
            </div>
            <div class="editor-empty">
            </div>
            <div class="editor-label">
                新<%: Html.LabelFor(model => model.Password) %>：
            </div>
            <div class="editor-field">
                <%: Html.PasswordFor(model => model.Password) %>
                <%: Html.ValidationMessageFor(model => model.Password) %>
            </div>
            <div class="editor-empty">
            </div>
            <div class="editor-label">
                <%: Html.LabelFor(model => model.RePassword) %>：
            </div>
            <div class="editor-field">
                <%: Html.PasswordFor(model => model.RePassword)%>
                <%: Html.ValidationMessageFor(model => model.RePassword)%>
            </div>
            <div class="editor-empty">
            </div>
            <div class="editor-label">
            </div>
            <div class="editor-field">
                <input id="btnSubmit" type="submit" value="修改成员" />
            </div>
            <div class="editor-empty">
            </div>
        </fieldset>
        <% } Html.RenderPartial("partialBackLink"); %>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#span_validationMessage").hide();

            $("#btnSubmit").click(function () {
                var oldPassword = $("#OldPassword");
                var span_validation = $("#span_validationMessage");
                if (oldPassword.val() == '') {
                    oldPassword.attr("style", "border:1px solid red; background-color:#FFEEEE");
                    span_validation.text("旧密码 字段是必需的。");
                    span_validation.show();
                }
            });

            $("#OldPassword").keyup(function () {
                var oldPassword = $("#OldPassword");
                if (oldPassword.val() != '') {
                    $("#span_validationMessage").hide();
                    oldPassword.removeAttr("style");
                }
            });
        });
    </script>
</asp:Content>
